define(function(){
	function brand(){
		$("#home_nav_second").css("display","none");
		$(".nav_list1").hover(
			function(){
				$("#home_nav_second").css("display","block")
			},
			function(){
				$("#home_nav_second").css("display","none")
			}
		)
		$(".nav_secondUl_li").hover(
			function(){
				$(this).find(".home_nav_three").stop().animate({
					right:-750
				},300);
				$(this).find(".home_nav_three").css("display","block")
			},
			function(){
				$(this).find(".home_nav_three").stop().animate({
					right:-730
				},300);
				$(this).find(".home_nav_three").css("display","none")
			}
		)
		page()
		function page(){
			var uls = $("#brand_list ul");
			var spans = $("#brand_page p span");
			var num = 0
			uls.eq(0).css("display","block").siblings().css("display","none");
			spans.eq(0).css("background","#333").siblings().css("background","#fff")
			spans.click(function(){
				num = $(this).index()-1;
				console.log(num);
				uls.eq(num).css("display","block").siblings().css("display","none");
				spans.eq(num).css("background","#333").siblings().css("background","#fff")
			})
			
			$(".brand_pre").click(function(){
				if(num == 0){
					num = 3
				}
				num--;
				uls.eq(num).css("display","block").siblings().css("display","none");
				spans.eq(num).css("background","#333").siblings().css("background","#fff")
			})
			$(".brand_next").click(function(){
				if(num == 2){
					num = -1
				}
				num++;
				uls.eq(num).css("display","block").siblings().css("display","none");
				spans.eq(num).css("background","#333").siblings().css("background","#fff")
			})
		}
		Json(".brand_ul")
		function Json(classname){
			$.getJSON("json/brandlist.json",function(data){
				
				$.each(data, function(index,value) {
						$(classname).append(`<li>
						<a class="brand_img" href="particulars.html" ><img src=${value.img} alt="" /></a>
						<p><a class="brand_name" href="">${value.name}</a></p>
						<p><span>${value.price}</span><del>${value.priced}</del></p>
					</li>`)
				});
			})
		}
	}
	return{
		brand:brand
	}
})
		